﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HardWare
{
    /// <summary>
    /// 硬件对接的容器，通过容器初始化后，可以访问多个容器（PLC，Modbus）任何数据
    /// 数据以路径方式读取，如plc.press.double表示读取名字为"plc"下的"press"的数据,并且以浮点的方式读取，内部各个硬件实现类会实现各自的通过路径查询数据的接口。
    /// </summary>
    public class HardWareContext
    {
        /// <summary>
        /// 
        /// </summary>
        public static void init()
        {

        }

        static HardWareContext hardWareContext = new HardWareContext();

        static Dictionary<String,HardWare> hwDic = new Dictionary<String,HardWare>();


        public static void AddHardWare(String hwName,HardWare hw)
        {
            hwDic.Add(hwName, hw);
        }

        public static void RemoveHardWare(String hwName)
        {
            hwDic.Remove(hwName);
        }

        public static Object getHardWareEnvValue(String path)
        {
            //String 
            //return ;
            return null;
        }


    }
}
